// +FHDR------------------------------------------------------------
//                 Copyright (c) 2022 .
//                       ALL RIGHTS RESERVED
// -----------------------------------------------------------------
// Filename      : ar_transaction.sv
// Author        : 
// Created On    : 2022-08-25 14:42
// Last Modified : 
// -----------------------------------------------------------------
// Description:
//
//
// -FHDR------------------------------------------------------------

`ifndef __AR_TRANSACTION_SV__
`define __AR_TRANSACTION_SV__

class ar_transaction extends uvm_sequence_item;

    rand bit [16 -1:0] size;
    rand bit [16 -1:0] addr;
    rand int          cycle_post;
    
    `uvm_object_utils_begin(ar_transaction)
        `uvm_field_int(size, UVM_ALL_ON)
        `uvm_field_int(addr, UVM_ALL_ON)
    `uvm_object_utils_end

    extern constraint size_cons;
    extern constraint addr_cons;
    extern constraint cycle_post_cons;
    
    extern function new(string name = "ar_transaction");
    extern virtual function ar_transaction clone();
	extern virtual function void pack();
	extern virtual function void unpack();
	
endclass: ar_transaction

constraint ar_transaction::size_cons{
}
constraint ar_transaction::addr_cons{
}
constraint ar_transaction::cycle_post_cons{
    cycle_post dist {0:/30, [1:10]:/30, [10:20]:/30};
}

function ar_transaction::new(string name = "ar_transaction");
	super.new(name);
endfunction

function ar_transaction ar_transaction::clone();
    ar_transaction to = new();
    to.size = this.size;
    to.addr = this.addr;
    return to;
endfunction: clone

function void ar_transaction::pack();
endfunction: pack

function void ar_transaction::unpack();
endfunction: unpack

`endif
